home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PRIVATE.ZIP
/
_PRINT.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
2KB
|
70 lines
#define CURSES_LIBRARY 1
#define NEEDS_OS2 1
#include <curses.h>
#ifndef NDEBUG
char *rcsid__print = "$Header: c:/curses/private/RCS/_print.c%v 2.0 1992/11/15 03:24:33 MH Rel $";
#endif
#ifdef OS2
# if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC)
#define INCL_DOS
#include <bsedos.h>
#endif
char Printer[]="LPT1:";
#endif
/*man-start*********************************************************************
PDC_print() - Provides primitive access to the BIOS printer functions
PDCurses Description:
This is a private PDCurses routine.
Implements write/init/read printer services at the BIOS level.
This provides the basic support that PDCurses needs to dump the
contents of windows or pads to the printer attached to the BIOS
printer port.
PDCurses Return Value:
See the BIOS INT 0x17 specifications.
PDCurses Errors:
See the BIOS INT 0x17 specifications.
Portability:
PDCurses int PDC_print( int cmd, int byte, int port );
**man-end**********************************************************************/
int PDC_print(int cmd, int byte, int port)
{
#ifdef FLEXOS
return( OK );
#endif
#ifdef DOS
int status = 0;
regs.h.ah = (unsigned char)cmd;
regs.h.al = (unsigned char)byte;
regs.x.dx = (unsigned int)port;
int86(0x17, ®s, ®s);
status = regs.h.ah;
return (status);
#endif
#ifdef OS2
# if !defined (CURSES__32BIT__) && !defined(CSET2)
HFILE Lpt;
USHORT Action;
USHORT NoWritten;
if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0)
return(ERR);
DosWrite(Lpt,&byte,1,&NoWritten);
DosClose(Lpt);
return(NoWritten == 1);
# endif
#endif
}